package com.eva.dao.system.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eva.framework.mp.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.util.Date;

@Data
@Accessors(chain = true)
@SuperBuilder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel("系统定时任务")
@TableName("`system_job`")
public class SystemJob extends BaseModel {

    @TableField("`job_name`")
    @ApiModelProperty(value = "JOB名称")
    private String jobName;

    @TableField("`job_description`")
    @ApiModelProperty(value = "JOB描述")
    private String jobDescription;

    @TableField("`handler`")
    @ApiModelProperty(value = "任务处理器类")
    private String handler;

    @TableField("`disallow_concurrent`")
    @ApiModelProperty(value = "是否禁用并发执行")
    private Boolean disallowConcurrent;

    @TableField("`disabled`")
    @ApiModelProperty(value = "是否禁用")
    private Boolean disabled;

    @TableField("`with_log`")
    @ApiModelProperty(value = "是否记录日志")
    private Boolean withLog;

    @TableField("`cron_expression`")
    @ApiModelProperty(value = "CRON表达式")
    private String cronExpression;

    @TableField("`allow_server_ips`")
    @ApiModelProperty(value = "服务器白名单")
    private String allowServerIps;

    @TableField("`status`")
    @ApiModelProperty(value = "状态（0准备，1运行中）", example = "1")
    private Byte status;

    @TableField("`lock_number`")
    @ApiModelProperty(value = "锁编号", example = "1")
    private Integer lockNumber;

    @TableField("`next_fire_time`")
    @ApiModelProperty(value = "预计下一次执行时间")
    private Date nextFireTime;

}
